<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增费用收支')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-fee-add">
        	<input name="customerId" type="hidden" id="customerId" />
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">收支类型：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('fee_type')}">
                        <input type="radio" th:id="${'feeType_' + dict.dictCode}" name="feeType" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
                        <label th:for="${'feeType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">收支金额：</label>
                <div class="col-sm-8">
                    <input name="feeMoney" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">收支时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="feeDate" class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">客户名称：</label>
                <div class="col-sm-8">
                    <div class="input-group">
	                    <input name="customerName" onclick="selectCustomer()" id="customerName" type="text" placeholder="请选择客户 " class="form-control" required readonly>
	                	<span class="input-group-addon"><i class="fa fa-search"></i></span>
					</div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">成交订单：</label>
                <div class="col-sm-8">
                    <input name="orderId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">费用名称：</label>
                <div class="col-sm-8">
                    <input name="feeName" class="form-control" type="text" placeholder="咨询费、招待费等 "  required>
                </div>
            </div>
            <div class="form-group">
				<label class="col-xs-3 control-label">备注：</label>
				<div class="col-xs-8">
					<textarea name="remark" maxlength="500" class="form-control" rows="3"></textarea>
				</div>
			</div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "crm/fee"
        $("#form-fee-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-fee-add').serialize());
            }
        }

        $("input[name='feeDate']").datetimepicker({
        });
        
        /*  费用收支-编辑-选择客户 */
        function selectCustomer() {
        	 var url = ctx + "crm/customer/selectCustomer";
        	 $.modal.open("选择客户", url);
		}
    </script>
</body>
</html>